package com.woniuxy.controller;

import com.woniuxy.direct.DirectProductor;
import com.woniuxy.fanout.FanoutProductor;
import com.woniuxy.simple.Productor;
import com.woniuxy.topic.TopicProductor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/4 0004-下午 4:15
 */
@RestController
@RequestMapping("/rabbit")
public class RabbitController {
    @Autowired
    private Productor productor;
    @Autowired
    private FanoutProductor fanoutProductor;
    @Autowired
    private DirectProductor directProductor;
    @Autowired
    private TopicProductor topicProductor;
    @RequestMapping("/send")
    public String  send(){
        productor.send();
        return "success";
    }
    @RequestMapping("fanoutsend")
    public String  fanoutSend(){
        fanoutProductor.send();
        return "fanout_success";
    }
    @RequestMapping("rout")
    public String  routSend(){
       directProductor.send();
        return "rout_success";
    }
    @RequestMapping("topic")
    public String  topicSend(){
        topicProductor.send();
        return "topic_success";
    }
}
